<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../include/base.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<link rel="stylesheet" href="../css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="../css/style.css">
	<link rel="stylesheet" href="../css/font-awesome.css">
  <style>
    .content{
       margin-left: 192px; 
       min-height: 700px;
    }
  </style>
</head>
<body>
	<%@ include file="include/top.jsp" %>
	<%@ include file="include/left.jsp" %>

    <!--right -->
<div class="content">
        
        <div class="header">
           <!--  <div class="stats">
               <p class="stat"><span class="number">53</span>tickets</p>
               <p class="stat"><span class="number">27</span>tasks</p>
               <p class="stat"><span class="number">15</span>waiting</p>
           </div> -->

            <h1 class="page-title">Home</h1>
        </div>
        
        <ul class="breadcrumb">
            <li><a href="index.html">Home</a> <span class="divider">/</span></li>
            <li class="active">商品系统<span class="divider">/</span></li>
            <li class="active">商品管理</li>
        </ul>

        <div class="container-fluid">
        	<c:if test="${not empty sessionScope.error }">
        		<div class="alert alert-error">
  					${sessionScope.error }
				</div>
				<c:remove var="error" scope="session"/>
        	</c:if>
            <div class="row-fluid">
                <div class="btn-toolbar">
                    <a href="booknew.jspx" class="btn btn-primary"><i class="icon-plus"></i> 新商品</a>
                    <button class="btn">从Excel导入</button>
                    <button class="btn">导出为Excel</button>
                  <div class="btn-group">
                  </div>
                </div>
                <div class="well">
                    <table class="table">
                      <thead>
                        <tr>
                          <th>#</th>
                          <th>商品名称</th>
                          <th>所属类别</th>
                          <th>状态</th>
                          <th>创建时间</th>
                          <th>库存</th>
                          <th style="width: 26px;"></th>
                        </tr>
                      </thead>
                      <tbody>
                      <c:forEach items="${page.list }" var="b" varStatus="vs">
                        <tr>
                          <td>${vs.count }</td>
                          <td>${b.bookname }</td>
                          <td>${b.bookType.typename }</td>
                          <td>${b.state }</td>
                          <td>${b.createtime }</td>
                          <td>${b.booknum }</td>
                          <td>
                              <a href="booktypeedit.jspx?id=${bt.id }"><i class="icon-pencil"></i></a>
                              <a href="javascript:;" class="del_link" rel="${bt.id }"><i class="icon-remove"></i></a>
                          </td>
                        </tr>
                       </c:forEach>
                       <c:if test="${empty page.list }">
                       	<tr>
                       		<td colspan="7">还没有任何数据</td>
                       	</tr>
                       </c:if>
                      </tbody>
                    </table>
                    
                </div>
                
                <c:if test="${page.totalPages > 1 }">
	                <div class="pagination pull-right">
	                  <ul>
	                    <li><a href="#">首页</a></li>
	                    <li><a href="#">上一页</a></li>
	                    <li><a href="#">下一页</a></li>
	                    <li><a href="#">尾页</a></li>
	                  </ul>
	                </div>
                </c:if>
        


                    
               <footer>
                  <hr>
                  <p>© 2012 <a href="http://www.kaishengit.com" target="_blank">凯盛软件</a></p>
              </footer>
                    
            </div>
        </div>
    </div>


	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script type="text/javascript" src="../js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$(".del_link").click(function(){
				if(confirm("确定要删除该记录吗？")) {
					location.href="booktypedel.jspx?id="+$(this).attr("rel");
				}
			});
		});
	</script>
</body>
</html>